package com.example.demo.vo

import com.example.demo.dbmodels.TDeptVideo
import io.swagger.annotations.ApiModelProperty

class DeptVideoVo {

    @ApiModelProperty("id")
    var id: Int? = null

    @ApiModelProperty("科室id")
    var deptId: Int? = null

    @ApiModelProperty("科室名称")
    var deptName: String? = null

    @ApiModelProperty("视频标题")
    var videoTitle: String? = null

    @ApiModelProperty("视频地址")
    var videoUrl: String? = null

    @ApiModelProperty("视频缩略图")
    var videoImageUrl: String? = null


    fun getVo(table: TDeptVideo): DeptVideoVo {
        table.let {
            val data = DeptVideoVo()
            data.id = it.id
            data.deptId = it.deptId
            data.deptName = it.deptName
            data.videoImageUrl = it.videoImageUrl
            data.videoTitle = it.videoTitle
            data.videoUrl = it.videoUrl
            return data
        }
    }

    fun getListVo(table: List<TDeptVideo>): List<DeptVideoVo> {
        table.let {
            val listDat = mutableListOf<DeptVideoVo>()
            it.forEach {
                val data = DeptVideoVo()
                data.id = it.id
                data.deptId = it.deptId
                data.deptName = it.deptName
                data.videoImageUrl = it.videoImageUrl
                data.videoTitle = it.videoTitle
                data.videoUrl = it.videoUrl
                listDat.add(data)
            }
            return listDat
        }
    }
}